package cn.myeasyai.config;

import cn.myeasyai.milvus.VectorService;
import cn.myeasyai.service.HuaweiObsFileServiceImpl;
import io.milvus.v2.client.MilvusClientV2;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author fushoujiang
 */
@Configuration
@Component
public class ScheduledConfig {
    private static final Logger LOGGER = LoggerFactory.getLogger(ScheduledConfig.class);

    @Resource
    private VectorService vectorService;
    /**
     * 每天清空数据
     */
    @Scheduled(cron = " 0 15 1 * * ?")
    public void cleanHeadImage() {
        LOGGER.info("cleanHeadImage,每天清空表数据，防止敏感信息泄漏");
        vectorService.cleanAll();
    }
}